package com.geo.auth.dto;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 用户信息响应DTO
 */
public class UserInfoResponse {
    
    /**
     * 用户ID
     */
    private String userId;
    
    /**
     * 用户名
     */
    private String username;
    
    /**
     * 邮箱
     */
    private String email;
    
    /**
     * 昵称
     */
    private String nickname;
    
    /**
     * 头像URL
     */
    private String avatar;
    
    /**
     * 真实姓名
     */
    private String realName;
    
    /**
     * 手机号
     */
    private String phone;
    
    /**
     * 角色列表
     */
    private List<String> roles;
    
    /**
     * 权限列表
     */
    private List<String> permissions;
    
    /**
     * 账户状态
     */
    private String status;
    
    /**
     * 创建时间
     */
    private LocalDateTime createTime;
    
    /**
     * 最后登录时间
     */
    private LocalDateTime lastLoginTime;
    
    // 构造函数
    public UserInfoResponse() {}
    
    // Getters and Setters
    public String getUserId() {
        return userId;
    }
    
    public void setUserId(String userId) {
        this.userId = userId;
    }
    
    public String getUsername() {
        return username;
    }
    
    public void setUsername(String username) {
        this.username = username;
    }
    
    public String getEmail() {
        return email;
    }
    
    public void setEmail(String email) {
        this.email = email;
    }
    
    public String getNickname() {
        return nickname;
    }
    
    public void setNickname(String nickname) {
        this.nickname = nickname;
    }
    
    public String getAvatar() {
        return avatar;
    }
    
    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }
    
    public String getRealName() {
        return realName;
    }
    
    public void setRealName(String realName) {
        this.realName = realName;
    }
    
    public String getPhone() {
        return phone;
    }
    
    public void setPhone(String phone) {
        this.phone = phone;
    }
    
    public List<String> getRoles() {
        return roles;
    }
    
    public void setRoles(List<String> roles) {
        this.roles = roles;
    }
    
    public List<String> getPermissions() {
        return permissions;
    }
    
    public void setPermissions(List<String> permissions) {
        this.permissions = permissions;
    }
    
    public String getStatus() {
        return status;
    }
    
    public void setStatus(String status) {
        this.status = status;
    }
    
    public LocalDateTime getCreateTime() {
        return createTime;
    }
    
    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }
    
    public LocalDateTime getLastLoginTime() {
        return lastLoginTime;
    }
    
    public void setLastLoginTime(LocalDateTime lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }
    
    // Builder 模式
    public static Builder builder() {
        return new Builder();
    }
    
    public static class Builder {
        private UserInfoResponse response;
        
        public Builder() {
            this.response = new UserInfoResponse();
        }
        
        public Builder userId(String userId) {
            response.setUserId(userId);
            return this;
        }
        
        public Builder username(String username) {
            response.setUsername(username);
            return this;
        }
        
        public Builder email(String email) {
            response.setEmail(email);
            return this;
        }
        
        public Builder nickname(String nickname) {
            response.setNickname(nickname);
            return this;
        }
        
        public Builder avatar(String avatar) {
            response.setAvatar(avatar);
            return this;
        }
        
        public Builder realName(String realName) {
            response.setRealName(realName);
            return this;
        }
        
        public Builder phone(String phone) {
            response.setPhone(phone);
            return this;
        }
        
        public Builder roles(List<String> roles) {
            response.setRoles(roles);
            return this;
        }
        
        public Builder permissions(List<String> permissions) {
            response.setPermissions(permissions);
            return this;
        }
        
        public Builder status(String status) {
            response.setStatus(status);
            return this;
        }
        
        public Builder userType(String userType) {
            response.setStatus(userType); // 使用status字段存储userType
            return this;
        }
        
        public Builder createTime(LocalDateTime createTime) {
            response.setCreateTime(createTime);
            return this;
        }
        
        public Builder lastLoginTime(LocalDateTime lastLoginTime) {
            response.setLastLoginTime(lastLoginTime);
            return this;
        }
        
        public Builder createdAt(LocalDateTime createdAt) {
            response.setCreateTime(createdAt);
            return this;
        }
        
        public UserInfoResponse build() {
            return response;
        }
    }
}